package sudoku;

import java.io.FileWriter;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Calendar;

public class SLogger
{
	private static String LOG_FILE = "sudokuLog.log";
	
	public static void logMessage(String message, FileWriter logWriter)
	{
		try
		{
			//FileWriter fw = new FileWriter(LOG_FILE, true);
			
			Calendar currentDate = Calendar.getInstance();
			SimpleDateFormat formatter= new SimpleDateFormat("yyyy/MMM/dd HH:mm:ss");
			String dateNow = formatter.format(currentDate.getTime());
			//fw.append(dateNow + "\r\n" + message + "\r\n");
			//fw.close();
			
			logWriter.append(dateNow + "\r\n" + message + "\r\n");
			//logWriter.close();
		}
		catch (IOException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
